package com.sinothk.gpserver.modules.texasPoker.helper.max5In7.ok;

import java.util.ArrayList;
import java.util.Arrays;

/**
 * 编写 Liang Y.T.
 * 时间 2021/7/2 14:56
 */
public class Test0 {
    public static void main(String[] args) {
//        c(7,5) =  7 * 6 / (1 * 2 );
        String[] data = {"1h", "2c", "js", "kd", "qh", "6c", "7h"};

        ArrayList<String[]> resList = f_1(data);
        for (int i = 0; i < resList.size(); i++) {
            System.out.println("第" + (i + 1) + ":");
            System.out.println(Arrays.toString(resList.get(i)));
        }


    }

    private static ArrayList<String[]> f_1(String[] data) {
        ArrayList<String[]> resultList = new ArrayList<>();

        int a = 0;
        for (int i = 0; i <= 2; i++) {
            for (int j = i + 1; j <= 3; j++) {
                for (int k = j + 1; k <= 4; k++) {
                    for (int x = k + 1; x <= 5; x++) {
                        for (int y = x + 1; y <= 6; y++) {
//                            a++;
//                            System.out.println("第" + a + ":");

                            String[] resultArr = new String[5];
                            resultArr[0] = data[i];
                            resultArr[1] = data[j];
                            resultArr[2] = data[k];
                            resultArr[3] = data[x];
                            resultArr[4] = data[y];
                            resultList.add(resultArr);
//                            System.out.println(data[i] + " " + data[j] + " " + data[k] + " " + data[x] + " " + data[y]);
                        }
                    }
                }
            }
        }

        return resultList;
    }
}